using System;
using System.IO;

namespace Editor
{
    public class ScriptsInfoRecoder : UnityEditor.AssetModificationProcessor
    {
        private static void OnWillCreateAsset(string path) {
            path = path.Replace(".meta", "");
            if (path.EndsWith(".cs")) {
                string str = File.ReadAllText(path);
                //str = str.Replace("Plane", Environment.UserName).Replace(
                str = str.Replace("#CreateTime#", string.Concat(DateTime.Now.Year, "/", DateTime.Now.Month, "/",
                    DateTime.Now.Day));
                File.WriteAllText(path, str);
            }
        }
    }
}